<html>
<head><meta charset="utf-8"><title>musl-build-scripts · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/musl-build-scripts.html">musl-build-scripts</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="205884079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/musl-build-scripts/near/205884079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> joey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/musl-build-scripts.html#205884079">(Aug 04 2020 at 08:40)</a>:</h4>
<p>Hi, I'm trying to help someone that is using musl as a target. They're compiling a project that uses bindgen, which looks like it attempts to dlopen libclang from the build script. This fails because a statically linked musl cannot dlopen. So I guess maybe build-scripts need to ignore crt-static, like proc macros do? <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_session/session.rs#L684">https://github.com/rust-lang/rust/blob/master/src/librustc_session/session.rs#L684</a></p>



<a name="205886328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/musl-build-scripts/near/205886328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> joey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/musl-build-scripts.html#205886328">(Aug 04 2020 at 09:13)</a>:</h4>
<p>For example, Alpine linux seems to disable static linking by default, possibly for issues like this <a href="https://git.alpinelinux.org/aports/tree/community/rust/musl-dont-use-crt-static.patch?id=d554ddc0a6ebf4a9350b88ccbe27ac1091faba5f">https://git.alpinelinux.org/aports/tree/community/rust/musl-dont-use-crt-static.patch?id=d554ddc0a6ebf4a9350b88ccbe27ac1091faba5f</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>